package org.jiamandan.com.strategy.enums;


import org.jiamandan.com.constant.YxConstant;

/**
 * @version Revision 1.0.1
 * @版权：版权所有 (c) 2021
 * @author:Lee
 * @email:honvy.lee@qq.com
 * @see:
 * @创建日期：2023-03-23 14:23
 * @功能说明：
 * @begin
 * @修改记录:
 * @修改后版本 修改人        修改内容
 * @2023-03-23 14:23	         Lee        	创建
 * @end
 */
public enum YXEventTagEnum {

    //JMD-YX
    //登录认证
    CMD_1(YxConstant.Cmd.CMD_1, YxConstant.Service.CMD_1),
    //桩心跳包
    CMD_3(YxConstant.Cmd.CMD_3, YxConstant.Service.CMD_3),
    CMD_5(YxConstant.Cmd.CMD_5, YxConstant.Service.CMD_5),
    CMD_9(YxConstant.Cmd.CMD_9, YxConstant.Service.CMD_9),
    CMD_13(YxConstant.Cmd.CMD_13, YxConstant.Service.CMD_13),
    CMD_15(YxConstant.Cmd.CMD_15, YxConstant.Service.CMD_15),
    CMD_19(YxConstant.Cmd.CMD_19, YxConstant.Service.CMD_19),
    CMD_23(YxConstant.Cmd.CMD_23, YxConstant.Service.CMD_23),
    CMD_25(YxConstant.Cmd.CMD_25, YxConstant.Service.CMD_25),
    CMD_27(YxConstant.Cmd.CMD_27, YxConstant.Service.CMD_27),
    CMD_29(YxConstant.Cmd.CMD_29, YxConstant.Service.CMD_29),
    CMD_31(YxConstant.Cmd.CMD_31, YxConstant.Service.CMD_31),
    CMD_33(YxConstant.Cmd.CMD_33, YxConstant.Service.CMD_33),
    CMD_35(YxConstant.Cmd.CMD_35, YxConstant.Service.CMD_35),
    CMD_41(YxConstant.Cmd.CMD_41, YxConstant.Service.CMD_41),
    CMD_55(YxConstant.Cmd.CMD_55, YxConstant.Service.CMD_55),
    CMD_57(YxConstant.Cmd.CMD_57, YxConstant.Service.CMD_57),
    CMD_59(YxConstant.Cmd.CMD_59, YxConstant.Service.CMD_59),
    CMD_f1(YxConstant.Cmd.CMD_f1, YxConstant.Service.CMD_f1);

    private String key;

    private String value;

    YXEventTagEnum(String key, String index) {
        this.key = key;
        this.value = index;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    //通过key-获取value
    public static String getValueByKey(String key) {
        for (YXEventTagEnum contextEnum : YXEventTagEnum.values()) {
            if (key.equals(contextEnum.key)) {
                return contextEnum.getValue();
            }
        }
        return "";
    }

    //通过vale-获取key
    public static String getKeyByValue(String value) {
        for (YXEventTagEnum contextEnum : YXEventTagEnum.values()) {
            if (value.equals(contextEnum.value)) {
                return contextEnum.getKey();
            }
        }
        return "0";
    }
}
